package org.aplikator.server.descriptor;

import org.aplikator.client.shared.descriptor.TextFieldDTO;
import org.aplikator.client.shared.descriptor.WidgetDTO;
import org.aplikator.server.Context;

import java.io.Serializable;

public class TextField<T extends Serializable> extends WidgetPropertyDescriptorBase<T> {


    public TextField(Property<T> property) {
        super(property);
    }

    @Override
    public WidgetDTO getWidgetDescriptor(Context ctx) {
        TextFieldDTO desc = new TextFieldDTO(getProperty().clientClone(ctx));
        desc.setSize(getSize());
        desc.setFormatPattern(getFormatPattern());
        desc.setEnabled(isEnabled());
        return desc;
    }




    @Override
    public String toString() {
        return "TextField{" + "property=" + getProperty() +  ", size=" + getSize() + '}';
    }

    
}
